# -*- coding: utf-8 -*-
# time: 2025/5/15 09:06
# file: ch01.py
# author: hanson
"""
https://www.langchain.com.cn/docs/how_to/sql_prompting/
"""
from langchain_community.utilities import SQLDatabase

db = SQLDatabase.from_uri("mysql+pymysql://root:1234qwer@192.168.6.43:3306/iot_ts", sample_rows_in_table_info=3)
print(db.dialect)
print(db.get_usable_table_names())
print(db.run("SELECT * FROM users LIMIT 10;"))

